﻿using DemoQLKhoSX.DatabaseAccessLayer;
using DemoQLKhoSX.EntityClasses;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DemoQLKhoSX.BusinessLogicLayer
{
    public class ThietKeBLO
    {
        private ThietKeDAO _ThietKeDAO;

        public ThietKeBLO()
        {
            _ThietKeDAO = new ThietKeDAO();
        }

        public ThietKeEntity getThietKeId(string id)
        {
            ThietKeEntity ThietKe = new ThietKeEntity();
            DataTable tbl = new DataTable();
            tbl = _ThietKeDAO.searchByID(id);

            if (tbl != null)
                foreach (DataRow r in tbl.Rows)
                {
                    ThietKe.IDMau = id;
                    ThietKe.TenMau = r["TenMau"].ToString();
                    ThietKe.KichCo = r["KichCo"].ToString();
                    ThietKe.MauSac = r["MauSac"].ToString();
                }
            return ThietKe;
        }
    }
}
